{% extends "admin/common/base.html" %}

    {% block style_link %}
    <link href="/public/style1/fonts/icomoon/style.css" rel="stylesheet">
    <link href="/public/style1/css/plugins.min.css" rel="stylesheet">
    <link href="/public/style1/css/style.min.css" rel="stylesheet">
    {% endblock %}
    {% block top_script %}
    <script type="text/javascript" src="/public/style1/js/vendor/modernizr-3.3.1.min.js"></script>
    {% endblock %}

{% block content %}
 <!-- Page-Title -->
                        <div class="row">
                            <div class="col-sm-12">
                                <h4 class="pull-left page-title">友链列表</h4>
                                <ol class="breadcrumb pull-right">
                                    <li><a href="#">Moltran</a></li>
                                    <li><a href="#">Tables</a></li>
                                    <li class="active">Editable Table</li>
                                </ol>
                            </div>
                        </div>


                        <div class="panel">

                            <div class="panel-body">
                                <div class="row">
                                    <div class="col-sm-6">
                                        <div class="m-b-30">
                                            <button id="addToTable" class="btn btn-success waves-effect waves-light">Add <i class="fa fa-plus"></i></button>
                                        </div>
                                    </div>
                                </div>
                                <table class="table table-bordered table-striped" id="datatable-editable">
                                    <thead>
                                        <tr>
                                            <th>友链名称</th>
                                            <th>友链描述</th>
                                            <th>友链状态</th>
                                            <th>友链操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    {% for item in page.elements %}
                                        <tr class="gradeX">
                                            <td>{{item.name}}</td>
                                            <td>{{item.description}}</td>
                                            <td>{{item.status}}</td>
                                            <td class="actions">
                                               <a href="/admin/friend_link_delete/{{item.uuid}}/{{page.page}}" class="on-default remove-row"><i class="fa fa-trash-o">删除</i></a>
                                                <a href="/admin/friend_link_publish/{{item.uuid}}/{{page.page}}" class="on-default save-row"><i class="ion-checkmark-circled">发布</i></a>
                                            </td>
                                        </tr>
                                    {% endfor %}
                                    </tbody>
                                </table>
                            </div>
                            <div class="pagination">
                                <ul class="pagination">
    {% if page.has_pre %}
      <li class=''><a href='/admin/friendLink_manage/{{ page.page-1 }}'>上一页</a></li>
   {%endif%}

    {% for index in range(page.size) %}
      {%  if page.page + index < page.total_page %}
       <li class="active"><a href="/admin/friendLink_manage/{{ page.page+index }}" rel="external nofollow" rel="external nofollow" >{{ page.page+index }}</a></li>
     {%endif%}
                                    {%endfor%}

    {% if page.has_next %}
      <li class=''><a href='/admin/friendLink_manage/{{ page.page + 1 }}'>下一页</a></li>
    {%endif%}
 </ul>
                    </div>
                </div>

{% endblock %}

{% block bottom_script %}
<script type="text/javascript" src="/public/style1/js/plugins.min.js"></script>
<script type="text/javascript" src="/public/style1/js/theme.min.js"></script>
{% endblock %}